<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!--
    Document   : sider
    Created on : 08-Mar-2009, 22:34:27
    Author     : Wenbo.Sun
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>sider</title>
    </head>
    <body>
        <script type="text/javascript">
            function choose(mode){
                if(mode == 'single')
                    ${"returnDate"}.disabled = true;
                                else
                    ${"returnDate"}.disabled = false;
                                }
        </script>
        <s:form action="flightSearch" id="searchForm">
            <s:url id="getAllAirports" action="getAllAirports.action" />
            <s:url id="getAllArrivals" action="getAllArrivals.action" />
            <table>
                <tr><td>From</td>
                    <td><s:autocompleter name="departure" theme="ajax" notifyTopics="/Refresh" href="%{getAllAirports}" cssStyle="width: 100px;" forceValidOption="true" autoComplete="false" indicator="indicator1" /></td>
                    <td><img id="indicator1" src="/images/indicator.gif" alt="Loading..." style="display:none"/></td>
                </tr>
                <tr><td>To</td>
                    <td><s:autocompleter name="arrival" theme="ajax" listenTopics="/Refresh" href="%{getAllArrivals}" formId="searchForm" cssStyle="width: 100px;" forceValidOption="true" autoComplete="false" indicator="indicator2" /></td>
                    <td><img id="indicator2" src="/images/indicator.gif" alt="Loading..." style="display:none"/></td>
                </tr>
                <s:datetimepicker name="leaveDate" toggleType="wipe" label="departure date" toggleDuration="300" value="today" displayFormat="dd/MM/yyyy"/>
                <s:datetimepicker id="returnDate" name="returnDate" toggleType="wipe" label="return date" toggleDuration="300" value="today" displayFormat="dd/MM/yyyy"/>
                <tr><td><s:radio list="{'return', 'single'}" label="mode of travel" name="mode" onfocus="choose(this.value);" /></td></tr>
                <tr>
                    <td></td>
                    <td><s:submit value="search"/></td>
                </tr>
            </table>
        </s:form>

    </body>
</html>
